package mapping

import (
	"maya-service/model"
	"maya-service/model/entity"
)

// AnswerRecordsEntityToDto entity data transfer
func AnswerRecordsEntityToDto(answerRecords []*entity.AnswerRecord) []*model.AnswerRecordInfo {
	out := make([]*model.AnswerRecordInfo, 0, len(answerRecords))
	for _, c := range answerRecords {
		out = append(out, AnswerRecordEntityToDto(c))
	}
	return out
}

// AnswerRecordEntityToDto entity data transfer
func AnswerRecordEntityToDto(e *entity.AnswerRecord) *model.AnswerRecordInfo {
	return &model.AnswerRecordInfo{

		Id: e.Id,

		UserId: e.UserId,

		Difficulty: e.Difficulty,

		FirstLevel: e.FirstLevel,

		SecondLevel: e.SecondLevel,

		Desc: e.Desc,

		AnswerValue: e.AnswerValue,

		CorrectNum: e.CorrectNum,

		Total: e.Total,

		Star: e.Star,

		CreatedAt: e.CreatedAt,

		UpdatedAt: e.UpdatedAt,
	}
}
